cmake_minimum_required(VERSION 3.15)

project ( hello_world_prj )

set( mylist )
list( APPEND mylist a )
list( APPEND mylist b )
list( APPEND mylist c )
message( STATUS "mylist = ${mylist}" )

set( tmplist )
list( APPEND tmplist d e)
list( APPEND mylist ${tmplist} )
message( STATUS "mylist-> ${mylist}" )


#file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}../ "*.cpp")
file(GLOB_RECURSE files  D:/workplace/repo/3750e1/*.c)

#message( STATUS "files = ${files}" )

message( STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR} CMAKE_SOURCE_DIR= ${CMAKE_SOURCE_DIR}"  )



macro ( test_macro1 dirs target_list )
    message( STATUS "in test_macro1 dirs = ${dirs} target_list =${target_list}" )
    message( STATUS "in test_macro1 dirs = ${dirs}" )
    list( APPEND target_list ${dirs} )
endmacro()


set( d1 1 2 )
set( test_list 6 )

test_macro1( d1  ${test_list})
message( STATUS "test_list = ${test_list}" )


# function 函数测试
# 函数名: xyz
function(xyz arg1 arg2)
     message("ARGC: ${ARGC}")
     message("ARGV: ${ARGV}")
     message("ARGN: ${ARGN}")
     message("ARGV0: ${ARGV0}")
     message("ARGV1: ${ARGV1}")
 
     # 循环打印出各个参数
     set(i 0)
     foreach(loop ${ARGV})
         message("arg${i}: " ${loop})
         math(EXPR i "${i} + 1")
     endforeach()
endfunction()
 
# 调用函数
xyz(A B C D E F G)

